CREATE PROCEDURE [acms].[EmailActivationCode_Delete]
	@Id int,
	@ConcurencyId rowversion
AS
	Update [EmailActivationCode]
	Set Deleted = 1
	Where Id = @Id and ConcurencyId = @ConcurencyId and Deleted = 0
	
	if(@@rowcount <> 1) begin
		if exists (select null from [EmailActivationCode] where Id = @Id and Deleted = 0)
			return -100
		else
			return -200
	end
RETURN 0